// Perfect match > Constant conversion > Upgrade conversion > Custom conversions > Variable length parameter

#include <iostream>
#include <cstring>

using namespace std;


// Perfect match
void foo( char* c, short s ) {				// _Z3fooPcs
	cout << "1.foo( char* c, short ) " << endl;
}

// Constant conversion
void foo( const char* c, short s ) {			// _Z3fooPKcs
	cout << "2.foo( const char* , short )" << endl;
}

// Upgrade conversion
void foo( const char* c, int s ) {			// _Z3fooPkci
	cout << "3.foo( const char* , int )" << endl;
}

// Standard conversion
void foo( char* c, char s ) { 				// _Z3fooPcc
	cout << "4.foo( char* c, char )" << endl;
}

// Variable length parameter
void foo( ... ) {					// _Z3fooz
	cout << "5.foo( ... )" << endl;
}


int main( void ){
	char* c; short b;
	foo( c, b );					// _Z3fooPcs( c, s )

	void(*pfunc)( const char*, short ) = foo;
	pfunc( c, b );					// _Z3fooPKcs
							// 2
							// It's up to function of pointer type

	return 0;
}



